home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_1entrydoor.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  145 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_1entrydoor.cog
  4. #    
  5. # Door to the innards of pyramid 1, opened with button on front face
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message    startup
  14. message    activated
  15.  
  16. # world things
  17. thing    button
  18. thing    door
  19. thing    player        local    nolink
  20.  
  21. # camera things, lookthings, etc.
  22. thing    doorcam                nolink
  23. thing    doortestcam            nolink
  24. thing    buttoncam            nolink
  25. thing    doorlook            nolink
  26.  
  27. # sectors
  28. sector    indoorsector        nolink
  29.  
  30. # indy's sayline
  31. sound    thisdoor=inxj076.wav    local
  32.  
  33. # music
  34. sound    openmusic=mus_pyr_openpyramid.wav    local
  35.  
  36. # variables
  37. int        locked=0    local
  38.  
  39. # subroutines
  40. flex    startscene=0.0        local
  41. flex    endscene=0.0        local
  42. flex    fixcams=0.0            local
  43. flex    movedoor=0.0        local
  44. flex    pushbutton=0.0        local
  45. end
  46.  
  47. code
  48. startup:
  49.     Sleep(.01);
  50.     
  51.     SetThingLight(door, '100 87 75', 0.001, 0.01);
  52.     SetThingLight(button, '100 87 75', 0.001, 0.01);    
  53.     SetSectorAdjoins(indoorsector, 0);
  54.  
  55.     return;
  56.  
  57. activated:
  58. # ---> door, button
  59.     if (locked) return;
  60.     locked = 1;
  61.  
  62.     player = GetLocalPlayerThing();
  63.     DeselectWeaponWait(GetLocalPlayerThing());
  64.     
  65.     if (GetSenderRef() == door)
  66.     {
  67.         SetExtCamOffsetToThing(doortestcam);
  68.     
  69.         PlayMode(player, 61, 1);
  70.         PlayVoice(player, thisdoor, 1, 1);
  71.         Sleep(.5);
  72.         RestoreExtCam();
  73.     
  74.         locked = 0;
  75.     }
  76.     
  77.     if (GetSenderRef() == button)
  78.     {
  79.         call startscene;
  80.  
  81.         call pushbutton;
  82.         call movedoor;
  83.         call endscene;
  84.     }
  85.     
  86.     return;
  87.  
  88. pushbutton:
  89.     SetExtCamOffsetToThing(buttoncam);
  90.     PlayMode(player, 60, 0);
  91.     Sleep(.25);
  92.     
  93.     PlaySoundLocal(openmusic, 1, 0, 0, 0);
  94.     
  95.     MoveToFrame(button, 1, 2);
  96.     Sleep(1);
  97.     return;
  98.  
  99. movedoor:
  100.     SetCameraFocus(2, doorcam);
  101.     SetCameraSecondaryFocus(2, doorlook);
  102.     SetCurrentCamera(2);
  103.     sleep(.1);
  104.     SetSectorAdjoins(indoorsector, 1);
  105.     
  106.     # door opens, camera moves in, cameralook slips backward into hallway
  107.     MoveToFrame(doorcam, 1, 1.4);
  108.     MoveToFrame(doorlook, 1, 2);
  109.     MoveToFrame(door, 1, .27);
  110.     WaitForStop(door);
  111.     sleep(1);
  112.     return;
  113.  
  114. startscene:
  115.     call fixcams;
  116.  
  117.     StartCutscene(1);
  118.     StopThing(player);
  119.     SetActorFlags(player, 0x200000);
  120.     
  121.     return;
  122.     
  123. endscene:
  124.     call fixcams;
  125.  
  126.     ClearActorFlags(player, 0x200000);
  127.     SetCameraSecondaryFocus(2, player);
  128.     SetCurrentCamera(1);
  129.     sleep(.3);
  130.     RestoreExtCam();
  131.     
  132.     EndCutscene();
  133.     
  134.     return;
  135.     
  136. fixcams:
  137.     #reset camera settings
  138.     ResetCameraFOV(0, 0);
  139.     SetCameraPosInterp(2, 0);
  140.     SetCameraLookInterp(2, 0);
  141.     return;
  142.     
  143. end
  144.  
  145.